import request from '@/utils/request'

// 查询接诊列表
export function listPatients(query) {
  return request({
    url: '/doctor/patients/list',
    method: 'get',
    params: query
  })
}

// 查询当日详情接诊列表
export function listDetail(query) {
  return request({
    url: '/doctor/patients/list1',
    method: 'get',
    params: query
  })
}

// 查询接诊详细
export function getPatients(id) {
  return request({
    url: '/doctor/patients/' + id,
    method: 'get'
  })
}

// 新增接诊
export function addPatients(data) {
  return request({
    url: '/doctor/patients',
    method: 'post',
    data: data
  })
}

// 修改接诊
export function updatePatients(data) {
  return request({
    url: '/doctor/patients',
    method: 'put',
    data: data
  })
}

// 删除接诊
export function delPatients(id) {
  return request({
    url: '/doctor/patients/' + id,
    method: 'delete'
  })
}

export function updateStatus(status) {
  return request({
    url: '/doctor/patients/update/' + status,
    method: 'get'
  })
}

//查询药品表
export function listDrug(drugName) {
  return request({
    url: '/doctor/patients/drugList',
    method: 'get',
    params: drugName
  })
}

// 生成诊断记录表和
export function preAndDiagnostic(data) {
  return request({
    url: '/doctor/patients/prescription',
    method: 'post',
    data: data
  })
}


// 查询患者userId
export function getPatientsUserId(id) {
  return request({
    url: '/doctor/patients/getUserId/' + id,
    method: 'get'
  })
}

// 修改接诊状态
export function receiveUpd(id) {
  return request({
    url: '/interrogation/receivePatients/receiveUpd?id=' + id,
    method: 'get',
  })
}
